package com.punegtug.opensocial.gifts.model;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

/**
 * Gift Transaction, keeps track of a tranasction, where a Gift is given by a
 * SENDER to a RECEIVER.
 * 
 * 
 * 
 * @author rohitghatol
 * 
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class GiftTransaction {
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
    private String encodedKey;
	@Persistent
	private String giftKey = null;
	@Persistent
	private String receiverId = null;
	@Persistent
	private String senderId = null;

	public String getKey(){
		return encodedKey;
	}
	/**
	 * @param gift
	 * @param receiverId
	 * @param senderId
	 */
	public GiftTransaction(String gift_key, String receiverId, String senderId) {
		super();
		this.giftKey = gift_key;
		this.receiverId = receiverId;
		this.senderId = senderId;
	}




	
	/**
	 * @return the gift
	 */
	public String getGiftKey() {
		return giftKey;
	}

	/**
	 * @param gift
	 *            the gift to set
	 */
	public void setGiftKey(String giftKey) {
		this.giftKey = giftKey;
	}

	/**
	 * @return the receiverId
	 */
	public String getReceiverId() {
		return receiverId;
	}

	/**
	 * @param receiverId
	 *            the receiverId to set
	 */
	public void setReceiverId(String receiverId) {
		this.receiverId = receiverId;
	}

	/**
	 * @return the senderId
	 */
	public String getSenderId() {
		return senderId;
	}

	/**
	 * @param senderId
	 *            the senderId to set
	 */
	public void setSenderId(String senderId) {
		this.senderId = senderId;
	}
}
